<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@include file="../common/jspcommon.jsp"%>

<script type="text/javascript">
var albumIden = "";
$(function(){
	$("#pager").pager({ pagenumber: ${albumPageModel.currentPage}, 
						pagecount: ${albumPageModel.totalPage},
						buttonClickCallback: function(page){
							$("#content_detail").load("albumInfo.htm?page="+page);
						}
	});
});
function myPhotoAll() {
	$("#content_detail").load("photoPage.htm");
}
function albumInfoUploadPhoto(album) {
	if (IsNull(album)) {
		if (!IsNull(albumIden)) {
			album = albumIden;
		} else {
			album = "";
		}
	}
	$("#photoContent").load("uploadPhoto.htm?albumId=" + album);
}

function friendAlbum() {
	$("#content_detail").load("albumFriend.htm");
}

//加载详细照片页面
function albumPagePhoto(album) {
	albumIden = album;
	$("#content_detail").load("photoPage.htm?album=" + album);
}
//相册编辑页面
function albumPageEdit(album) {
	albumIden = album;
	$("#photoContent").load("albumEdit.htm?album=" + album);
}
</script>

<!--内容快-->
<div class="h_main2">
	<div class="h_data">
		<h2>
			<img src="images/home_images/ico28.png" alt="相册" />
			相册
		</h2>
		<div class="h_newNews">
			<ul>
				<li id="newNews1" onclick="albumInfo();" class="h_newNewsHover">
					<a>家的照片</a>
				</li>
				<!-- 
						<li id="newNews2" onclick="friendAlbum();">
							<a>邻居的照片</a>
						</li>
						 -->
				<span><a href="javascript:void(0);" id="uploadPhoto"
					onclick="albumInfoUploadPhoto();">上传照片</a> </span>
			</ul>
			<div class="clear"></div>
		</div>
		<div id="photoContent">
			<div class="h_newNews_box">
				<div class="h_newNews_text" id="con_newNews_1"
					style="display: block;">
					<div class="data_h_newNews_nav" id="my_photo_top">
						<a href="javascript:void(0);" class="current"
							onclick="albumInfo();">家的照片专辑</a>|
						<a href="javascript:void(0);" onclick="myPhotoAll();">家的全部照片</a>
					</div>
					<div class="clear"></div>
					<div id="photoBox">
						<div class="photos_box">
							<c:choose>
								<c:when test="${albumPageModel.totalRecord <1}">
									<div style="margin-top: 20px; margin-left: 20px;">
										您目前还没有上传照片，请点击‘<a href="javascript:void(0);"
													onclick="albumInfoUploadPhoto('');">上传照片</a>’创建您的专辑，上传照片
									</div>
									
								</c:when>
								<c:otherwise>
									<ul>
										<c:forEach items="${albumPageModel.list}" var="album">
											<li>
												<div class="phots_img">
													<div
															style="width: 153px; height: 112px; overflow: hidden; text-align: center;">
													<a href="javascript:void(0);"
														onclick="albumPagePhoto('${album.identifier}')">
														
															<img
																<c:choose>
																			<c:when test="${album.cover!=null && album.cover!=''}">
																				src="${album.imageServer}${album.cover}"
																			</c:when> 
																			<c:otherwise>
																				src="images/avatar/album.jpg"
																			</c:otherwise>
																		</c:choose>
																alt="相册" />
														 </a>
														 </div>
													<span> <a href="javascript:void(0);"
														class="phots_imgName"><c:out value="${album.name}"></c:out>(${album.pictureAmount})
													</a> <a href="javascript:void(0);"
														onclick="albumPageEdit('${album.identifier}')">编辑</a> </span>
												</div>
											</li>
										</c:forEach>
								<div class="clear"></div>
							</ul>
								</c:otherwise>
							</c:choose>
							
						</div>
						<c:if test="${albumPageModel.totalRecord > 0}">
							<div id="pager" class="h_page"></div>	
						</c:if>
					</div>
				</div>

			</div>
		</div>
	</div>
</div>
<div class="clear"></div>

